<!-- <template>
    <img :src="src" alt="" ref="img">
</template>

<script setup lang="ts">
import {onMounted,ref,useTemplateRef,defineProps} from 'vue'
const props = defineProps(['dataSrc'])
const img = useTemplateRef('img')
const src = ref('https://img.zcool.cn/community/01dcb55ddf5e32a80121597263ce93.gif')
onMounted(()=>{
    if (img.value) {
        const observer = new IntersectionObserver(entries=>{
            if (entries[0].intersectionRatio<=0) return
                
            img.value!.src = props['dataSrc']
            observer.unobserve(img.value!)
        })
        observer(img.value)
    }
})

</script> -->